﻿using Microsoft.AspNetCore.Mvc;
using Microsoft.Extensions.Options;
using System.Threading.Tasks;
using Zop;

namespace ImgUpload.Controllers
{
    [Route("[controller]")]
    [ApiController]
    public class ConfigController : ControllerBase
    {
        private readonly ConfigDto _config;
        public ConfigController(IOptions<ConfigDto> config)
        {
            _config = config?.Value;
        }

        public Task<Result<ConfigDto>> Index()
        {
            var config = Result<ConfigDto>.ReSuccess(_config);
            return Task.FromResult(config);
        }
    }
}